package com.cirnoworks.uhs.server;

import java.util.HashMap;

public class Session {
	private UserKey key;
	private final HashMap<Character, PortMap> portmaps = new HashMap<Character, PortMap>();
	private final long createdDate;
	private String userName;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Session(UserKey key) {
		this.key = key;
		this.createdDate = System.currentTimeMillis();
	}

	public UserKey getKey() {
		return key;
	}

	public void setKey(UserKey key) {
		this.key = key;
	}

	public HashMap<Character, PortMap> getPortmaps() {
		return portmaps;
	}

	public boolean isTimeout() {
		return (System.currentTimeMillis() - createdDate) > 300000l;
	}
}
